Ball knowledge is never easy to obtain. A person can watch highlights for years and never truly “know ball”. In the past, ball knowledge was only able to be obtained by watching games with your own two eyes, but today more statistics are being recorded and are readily available to all then ever before. Knowing this, I set out to see if many of the opinions I have seen on social media are backed up by facts or simply blasphemy spread by non ball knowers. For this analysis I will be using Basketball Reference. This website has everything there is to know about basketball. From stats of players you’ve never heard of to stats of your favorite player, its got it all. I used this database of stats throughout this project to analyze the different eras of basketball and give my selection for 2025 NBA Champion
Many NBA fans of the older generations love to spit out claims like “the games too soft” or “_____ wouldn’t survive an older era” and fans of the newer generation love to say “_____ played against plumbers” or “They would charge _____ with witchcraft in the 70’s”. Well I have turned to the stats to look at league trends over time to determine who is right.
This NBA season has been one for the ages and there is no real front runner to be NBA champion. The Thunder and Cavs are the two one seeds with very impressive rosters, but both teams lack playoff experience. The reigning champion Celtics are still very impressive and many peoples favorite to win it all. Steph Curry and the Warriors are still around and have a chance at it too. Its almost impossible to tell who will come out on top this year, but I’m going to use the stats of previous champions to generate a statistics based guess on who will win it all. (Disclaimer: I am not liable for any money lost on bets placed on my prediction)
Steph Curry and the Warriors in the 2010’s demonstrated how effective shooting as many threes as possible can be at winning championships and the league followed suit.
With an increase in threes being taken, it would be expected that the league wide FG% would decrease due to it being a more difficult shot, however today the average FG% is only 2 less than the days of the two point shot. This says alot about how skilled the players of today are at shooting threes.
With more threes being taken without a drop in efficiency, it would be expected that the average number of points scored by a team in a game would be at an all time high. Unexpectedly this isn’t true. The average points scored by a team was actually the highest in the 60’s. This could be Wilt Chamberlain’s doing, or it could be attributed to the poor defense of the early league. My interpretation is that two point efficiency was maxed out when the league first began, then defense caught up slowly with its peak in the late 90’s and early 2000’s, and now offence is back on top in the three point era.
Physicality and defense lack great statistics. There’s no great way to quantify how rough the play is at any given time, but we can look at one of the few defensive stats we do have and draw conclusions from there.
One indicator of the physicality of the league is how often players are at the line. I have to say that the old heads may be on to something. Even with the foul baiting and seemingly doing everything possible to get to the line, free throw attempts are at an all time low.
Below, data from the previous 15 champions was collected and averaged. I have decided to determine my champion by comparing the remaining contenders in the playoffs with the average champion in selected categories. The categories I selected were Offense (FG %), Turnovers, Rebounds, Free Throw %, and Age due to their importance in the playoffs.
Offense
An efficient offence is necessary for a championship team. As you can see from the Offense bar chart, Cleveland, Denver, Indiana, New York, and OKC have equal or more efficient offences than the average champion.
Turnovers
Turnovers can be detrimental to a team in tough playoff games. A turnover means even if your offense is great they may not get the chance to shoot.The Turnover bar chart shows that Boston, Cleveland, Indiana, New York, and OKC have less turnovers than the average champion.
Rebounds
Rebounds are important because they can turn missed shots into another possession or keep the other team from getting another possession. Only Indiana and New York have less rebounds than the average champion.
Free Throws
Many playoff basketball games come down to the wire and its very important to make your free throws at the end of a game. Only Denver and Golden State have a worse free throw percentage than the average champion.
Age
Age, while it may not seem very important, can really hurt a playoff team. Younger teams are more likely to fold under the pressure and lose tough games. Only Boston and Golden State have teams older than the average champion (Makes sense when you look at their success in previous years).
The previous comparison to the average champion has narrowed the field down from 8 teams to 3. Each category was analyzed to see if the team was fit to be the champion and a percentage was gathered using the following equation:
Number of categories better than the average champ/Total Categories
The results are shown below:
Bos: 80%
Cle: 80%
Den: 40%
Gsw: 40%
Ind: 60%
Min: 40%
Nyk: 60%
Okc: 80%
Since the Cavs and the Celtics are both in the eastern conference its only possible for on of these teams to make it to the championship. I decided to look at the previous two season head to head regular season record to see who has won more games.
Since the Celtics had the better record against the Cavs they now advance to face the Thunder. I decided to look at the previous two season head to head regular season record for these two teams to see who has won more games and decide the champion.
This makes the Oklahoma City Thunder my pick for the 2025 nba champion. This is a really great young team that has a really promising future ahead of them if they win this year and could be the start to a new dynasty.
No matter how much research or analysis you do, the nature of sports and why many people love them is the unpredictability of them. Everyone loves an upset or when something happens that you would have never expected. The fact is the better team doesn’t always win and this really limits the usefulness of stats on sports. It can never truly replace watching the games and enjoying it for what it is.
---
title: "NBA Statistical Analysis"
output:
flexdashboard::flex_dashboard:
theme:
version: 4
bootswatch: default
navbar-bg: "red"
orientation: columns
vertical_layout: fill
source_code: embed
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(DT)
library(plotly)
seasonavg<-read_delim("C:/Users/ngles/OneDrive/Documents/School/MTH 209/Final Project/Season Averages.txt")
Champs<-read_delim("C:/Users/ngles/OneDrive/Documents/School/MTH 209/Final Project/Champs and Contenders.txt")
```
Intro
===
Ball knowledge is never easy to obtain. A person can watch highlights for years and never truly "know ball". In the past, ball knowledge was only able to be obtained by watching games with your own two eyes, but today more statistics are being recorded and are readily available to all then ever before. Knowing this, I set out to see if many of the opinions I have seen on social media are backed up by facts or simply blasphemy spread by non ball knowers. For this analysis I will be using [Basketball Reference](https://www.basketball-reference.com/). This website has everything there is to know about basketball. From stats of players you've never heard of to stats of your favorite player, its got it all. I used this database of stats throughout this project to analyze the different eras of basketball and give my selection for 2025 NBA Champion
Column {data-width=500}
---
### How has the NBA changed over the years
Many NBA fans of the older generations love to spit out claims like "the games too soft" or "_____ wouldn't survive an older era" and fans of the newer generation love to say "_____ played against plumbers" or "They would charge _____ with witchcraft in the 70's". Well I have turned to the stats to look at league trends over time to determine who is right.
###

Column {data-width=500}
---
### Who will Win it All in 2025?
This NBA season has been one for the ages and there is no real front runner to be NBA champion. The Thunder and Cavs are the two one seeds with very impressive rosters, but both teams lack playoff experience. The reigning champion Celtics are still very impressive and many peoples favorite to win it all. Steph Curry and the Warriors are still around and have a chance at it too. Its almost impossible to tell who will come out on top this year, but I'm going to use the stats of previous champions to generate a statistics based guess on who will win it all. (Disclaimer: I am not liable for any money lost on bets placed on my prediction)
###

Different Eras, Different Shots
===
Column {.tabset data-width=900}
---
### 3-pointers
Steph Curry and the Warriors in the 2010's demonstrated how effective shooting as many threes as possible can be at winning championships and the league followed suit.
```{r 3ptscat}
threes<-seasonavg[-1,]%>%select(c(`...2`,`Per Game...12`))
threes<-threes%>%drop_na(`Per Game...12`)%>%arrange(`...2`)%>%mutate(`Per Game...12` = as.numeric(`Per Game...12`))%>% rename(Season = `...2`, Three_Point_Attempts = `Per Game...12`)
p<-ggplot(threes, aes(x=Season, y=Three_Point_Attempts))+geom_point(color="blue")+labs(title = "Average 3-Point Attempts Each Season", y = "3-Point Attempts", x = "Season")+scale_x_discrete(breaks = threes$Season[seq(1, nrow(threes), by = 5)])
ggplotly(p, width=1200, height=600)
```
### Efficiency
With an increase in threes being taken, it would be expected that the league wide FG% would decrease due to it being a more difficult shot, however today the average FG% is only 2 less than the days of the two point shot. This says alot about how skilled the players of today are at shooting threes.
```{r fgscat}
fg<-seasonavg[-1,]%>%select(c(`...2`,`Shooting...24`))
fg<-fg%>%drop_na(`Shooting...24`)%>%arrange(`...2`)%>%mutate(`Shooting...24` = as.numeric(`Shooting...24`))%>% rename(Season = `...2`, FG_Percent = `Shooting...24`)
p<-ggplot(fg, aes(x=Season, y=FG_Percent))+geom_point(color="green")+labs(title = "Average FG% Each Season", y = "FG Efficency (%)", x = "Season")+scale_x_discrete(breaks = fg$Season[seq(1, nrow(fg), by = 5)])
ggplotly(p, width=1000, height=500)
```
### Points
With more threes being taken without a drop in efficiency, it would be expected that the average number of points scored by a team in a game would be at an all time high. Unexpectedly this isn't true. The average points scored by a team was actually the highest in the 60's. This could be Wilt Chamberlain's doing, or it could be attributed to the poor defense of the early league. My interpretation is that two point efficiency was maxed out when the league first began, then defense caught up slowly with its peak in the late 90's and early 2000's, and now offence is back on top in the three point era.
```{r ptsscat}
pts<-seasonavg[-1,]%>%select(c(`...2`,`Per Game...23`))
pts<-pts%>%drop_na(`Per Game...23`)%>%arrange(`...2`)%>%mutate(`Per Game...23` = as.numeric(`Per Game...23`))%>% rename(Season = `...2`, Points = `Per Game...23`)
p<-ggplot(pts, aes(x=Season, y=Points))+geom_point(color="red")+labs(title = "Average Points Per Game Each Season", y = "Points", x = "Season")+scale_x_discrete(breaks = pts$Season[seq(1, nrow(pts), by = 5)])
ggplotly(p, width=1200, height=450)
```
Softer New NBA
===
Physicality and defense lack great statistics. There's no great way to quantify how rough the play is at any given time, but we can look at one of the few defensive stats we do have and draw conclusions from there.
Column {data-width=900}
---
### Free Throw Attempts
One indicator of the physicality of the league is how often players are at the line. I have to say that the old heads may be on to something. Even with the foul baiting and seemingly doing everything possible to get to the line, free throw attempts are at an all time low.
```{r ftscat}
fts<-seasonavg[-1,]%>%select(c(`...2`,`Per Game...14`))
fts<-fts%>%drop_na(`Per Game...14`)%>%arrange(`...2`)%>%mutate(`Per Game...14` = as.numeric(`Per Game...14`))%>% rename(Season = `...2`, Free_Throw_Attempts = `Per Game...14`)
p<-ggplot(fts, aes(x=Season, y=Free_Throw_Attempts))+geom_point(color="red")+labs(title = "Average Free Throw Attempts Per Game Each Season", y = "Free Throw Attempts", x = "Season")+scale_x_discrete(breaks = fts$Season[seq(1, nrow(fts), by = 5)])
ggplotly(p, width=1200, height=450)
```
Previous Champions
===
Below, data from the previous 15 champions was collected and averaged. I have decided to determine my champion by comparing the remaining contenders in the playoffs with the average champion in selected categories. The categories I selected were Offense (FG %), Turnovers, Rebounds, Free Throw %, and Age due to their importance in the playoffs.
Column {data-width=300}
---
### Data
```{r filtcont}
Champs<-Champs%>%select(Season, Tm:L, Age:Wt., G:PTS)%>%arrange(Season)
years<-c(seq(from=10, to=25, by=1), rep(25,7))
Champs<-add_column(Champs,years)
Champs<-Champs%>%mutate(champion=years!=25)
Champs<-Champs%>%select(years, champion, Tm:PTS)
Trophy<-Champs%>%filter(champion==TRUE)
Contenders<-Champs%>%filter(champion==FALSE)
Trophy$Ht.<-c(6.583, rep(6.5, 4), rep(6.583, 4), 6.417, 6.583, 6.5, 6.417, 6.5, 6.583 )
avgchamp<-c(0, 0,"AVG Champ" , mean(Trophy$W), mean(Trophy$L), mean(Trophy$Age), mean(Trophy$Ht.), mean(Trophy$Wt.), mean(Trophy$G), mean(Trophy$MP), mean(Trophy$FG), mean(Trophy$FGA), mean(Trophy$`FG%`), mean(Trophy$`3P`), mean(Trophy$`3PA`), mean(Trophy$`3P%`),mean(Trophy$`2P`), mean(Trophy$`2PA`), mean(Trophy$`2P%`),mean(Trophy$`FT`), mean(Trophy$`FTA`), mean(Trophy$`FT%`), mean(Trophy$ORB), mean(Trophy$DRB),mean(Trophy$TRB),mean(Trophy$AST), mean(Trophy$STL),mean(Trophy$BLK), mean(Trophy$TOV), mean(Trophy$PF),mean(Trophy$PTS) )
Contenders$Ht.<- c(rep(6.583, 2), rep(6.417,2), rep(6.5, 4))
Contenders<-rbind(Contenders,avgchamp)
Contenders<-select(Contenders,Tm:PTS)
datatable(Contenders, width=300, height=250)
```
Column {.tabset data-width=700}
---
### Offense
```{r contfgcomp, fig.width=8, fig.height=5}
Contenders$`FG%`<-as.numeric(Contenders$`FG%`)
ggplot(Contenders, aes(x = Tm, y=`FG%`)) + geom_bar(stat="identity", fill="red") + geom_hline(yintercept = 0.481333, color = "blue") + labs(title = "FG% Comparison Contenders v.s. Avg Champion", x = "Team", y = "FG%")+coord_cartesian(ylim=c(.4, .5))
```
### Turnovers
```{r conttovcomp, fig.width=8, fig.height=5}
Contenders$TOV<-as.numeric(Contenders$TOV)
ggplot(Contenders, aes(x = Tm, y=TOV)) + geom_bar(stat="identity", fill="yellow") + geom_hline(yintercept = 1130.333, color = "green") + labs(title = "Turnover(TOV) Comparison Contenders v.s. Avg Champion", x = "Team", y = "TOV")+coord_cartesian(ylim=c(900, 1200))
```
### Rebounds
```{r conttrbcomp, fig.width=8, fig.height=5}
Contenders$TRB<-as.numeric(Contenders$TRB)
ggplot(Contenders, aes(x = Tm, y=TRB)) + geom_bar(stat="identity", fill="blue") + geom_hline(yintercept = 3499.666, color = "red") + labs(title = "Total Rebound(TRB) Comparison Contenders v.s. Avg Champion", x = "Team", y = "TRB")+coord_cartesian(ylim=c(3300, 3800))
```
### Free Throw %
```{r contftcomp, fig.width=8, fig.height=5}
Contenders$`FT%` <-as.numeric(Contenders$`FT%`)
ggplot(Contenders, aes(x = Tm, y=`FT%`)) + geom_bar(stat="identity", fill="orange") + geom_hline(yintercept = .773, color = "purple") + labs(title = "Free Throw % Comparison Contenders v.s. Avg Champion", x = "Team", y = "FT%")+coord_cartesian(ylim=c(.6, .85))
```
### Age
```{r contagecomp, fig.width=8, fig.height=5}
Contenders$Age <-as.numeric(Contenders$Age)
ggplot(Contenders, aes(x = Tm, y=Age)) + geom_bar(stat="identity", fill="red") + geom_hline(yintercept = 28.39, color = "yellow") + labs(title = "Age Comparison Contenders v.s. Avg Champion", x = "Team", y = "Age")+coord_cartesian(ylim=c(23, 30))
```
### Analysis
**Offense**
An efficient offence is necessary for a championship team. As you can see from the Offense bar chart, Cleveland, Denver, Indiana, New York, and OKC have equal or more efficient offences than the average champion.
**Turnovers**
Turnovers can be detrimental to a team in tough playoff games. A turnover means even if your offense is great they may not get the chance to shoot.The Turnover bar chart shows that Boston, Cleveland, Indiana, New York, and OKC have less turnovers than the average champion.
**Rebounds**
Rebounds are important because they can turn missed shots into another possession or keep the other team from getting another possession. Only Indiana and New York have less rebounds than the average champion.
**Free Throws**
Many playoff basketball games come down to the wire and its very important to make your free throws at the end of a game. Only Denver and Golden State have a worse free throw percentage than the average champion.
**Age**
Age, while it may not seem very important, can really hurt a playoff team. Younger teams are more likely to fold under the pressure and lose tough games. Only Boston and Golden State have teams older than the average champion (Makes sense when you look at their success in previous years).
Your 2025 NBA Champion
===
Column {data-width=300}
---
### The Final Three
The previous comparison to the average champion has narrowed the field down from 8 teams to 3. Each category was analyzed to see if the team was fit to be the champion and a percentage was gathered using the following equation:
**Number of categories better than the average champ/Total Categories**
The results are shown below:
**Bos: 80%**
**Cle: 80%**
Den: 40%
Gsw: 40%
Ind: 60%
Min: 40%
Nyk: 60%
**Okc: 80%**
Column {.tabset data-width=700}
---
### CLE V.S BOS HTH
Since the Cavs and the Celtics are both in the eastern conference its only possible for on of these teams to make it to the championship. I decided to look at the previous two season head to head regular season record to see who has won more games.
```{r pcc, fig.width=8, fig.height=5}
percent<- c(43,57)
pie_labels<- paste(percent, "%", sep="")
pie(percent, main="Head to head Results(CLE v.s BOS)", labels=pie_labels, col=c("red", "green"))
legend("topright", c("Cavaliers","Celtics"), cex=0.8, fill=c("red", "green"))
```
### OKC V.S BOS HTH
Since the Celtics had the better record against the Cavs they now advance to face the Thunder. I decided to look at the previous two season head to head regular season record for these two teams to see who has won more games and decide the champion.
```{r pco, fig.width=8, fig.height=5}
percent<- c(75,25)
pie_labels<- paste(percent, "%", sep="")
pie(percent, main="Head to head Results(OKC v.s BOS)", labels=pie_labels, col=c("lightblue", "green"))
legend("topright", c("Thunder","Celtics"), cex=0.8, fill=c("lightblue", "green"))
```
### The Champion
This makes the Oklahoma City Thunder my pick for the 2025 nba champion. This is a really great young team that has a really promising future ahead of them if they win this year and could be the start to a new dynasty.

Limitations
===
No matter how much research or analysis you do, the nature of sports and why many people love them is the unpredictability of them. Everyone loves an upset or when something happens that you would have never expected. The fact is the better team doesn't always win and this really limits the usefulness of stats on sports. It can never truly replace watching the games and enjoying it for what it is.
Column {data-width=900}
---
